<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">
        <div><?php include "../public_flow/flow_show_info.php";?></div>
        <div class="tongbox tongbox5 business_1 layui-hide">
            <div class="tuo"><div class="tit">项目名称</div><div class="con" id="tong_name"></div></div>
            <div class="tuo"><div class="tit">收款单号</div><div class="con" id="tong_number"></div></div>
            <div class="tuo"><div class="tit">款项类型</div><div class="con" id="tong_feilei_name"></div></div>
            <div class="tuo"><div class="tit">到账金额(元)</div><div class="con" id="tong_money"></div></div>
            <div class="tuo"><div class="tit">到账日期</div><div class="con" id="tong_dt"></div></div>
        </div>
        <div class="tongbox tongbox5 business_2 layui-hide">
            <div class="tuo"><div class="tit">项目名称</div><div class="con" id="tong_name2"></div></div>
            <div class="tuo"><div class="tit">款项类型</div><div class="con" id="tong_feilei_name2"></div></div>
            <div class="tuo"><div class="tit">到账金额(元)</div><div class="con" id="tong_money2"></div></div>
            <div class="tuo"><div class="tit">到账日期</div><div class="con" id="tong_dt2"></div></div>
            <div class="tuo"><div class="tit">本次扣收金额(元)</div><div class="con" id="tong_koufee"></div></div>
        </div>
        <div class="table-box tablenes">
            <div class="title">项目信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">项目名称</td><td class="tv colorlan" id="enginid_name" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">收款信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">收款单号</td><td class="tv" id="number"></td><td class="tt">款项类型</td><td class="tv" id="feilei_name"></td></tr>
                <tr><td class="tt">款项摘要</td><td class="tv" id="zhai" colspan="3"></td></tr>
                <tr><td class="tt">到账金额(元)</td><td class="tv" id="money"></td><td class="tt">付款方</td><td class="tv" id="duier"></td></tr>
                <tr><td class="tt">到账方式</td><td class="tv" id="incdaotype_name"></td><td class="tt">到账账户</td><td class="tv" id="accid_name"></td></tr>
                <tr><td class="tt">到账日期</td><td class="tv" id="dt"></td><td class="tt">经办人</td><td class="tv" id="baner"></td></tr>
                <tr><td class="tt">备注</td><td class="tv" id="explain" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <script type="text/html" id="toolbarDemo_list">收款明细</script>
            <div class="tableShow">
                <table id="datalist_list" lay-filter="datalist_list"></table>
            </div>
        </div>

        <div class="table-box tablenes business_2 layui-hide">
            <div class="title">扣收信息</div>
            <table class="layui-table">
                <tbody>
                <tr class="iskoushi layui-hide"><td class="tt">待扣合计不含本次(元)</td><td class="tv colorlan" id="daikouallfee"></td><td class="tt">本次到款应计管理费(元)</td><td class="tv" id="benguanfee"></td></tr>
                <tr class="iskoushi layui-hide"><td class="tt">待扣合计含本次(元)</td><td class="tv" id="daikouhanfee"></td><td class="tt">本次收款是否扣收</td><td class="tv" id="iskou"></td></tr>
                <tr class="iskoushi layui-hide"><td class="tt">本次扣收金额(元)</td><td class="tv" id="koufee"></td><td class="tt">其中管理费扣收(元)</td><td class="tv" id="kouguanfee"></td></tr>
                <tr class="iskoushi layui-hide"><td class="tt">其中税费扣收(元)</td><td class="tv" id="koushuifee"></td><td class="tt">其中其他费扣收(元)</td><td class="tv" id="kouqifee"></td></tr>
                </tbody>
            </table>
        </div>


        <div><?php include "../public/upinfo_show.php";?></div>

        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>



        <div class="table-box tablenes iskoushi layui-hide">
            <script type="text/html" id="toolbarDemo_kou">扣收明细</script>
            <div class="tableShow">
                <table id="datalist_kou" lay-filter="datalist_kou"></table>
            </div>
        </div>


        <div><?php include '../public_flow/flow_show_shenlog.php'?></div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>

    <?php include 'showrrboxtext.php'?>
    <div><?php include '../public/shrrbox.php'?></div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_shou_xiang_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;
                var engininfo = res.data.engininfo;
                var account = res.data.account;

                $("#flowdingname").text(data.zhai);


                if(engininfo){
                    if(engininfo.business == 1){
                        $(".business_1").removeClass('layui-hide');
                    }else{
                        $(".business_2").removeClass('layui-hide');
                    }
                    if(engininfo){
                        $("#tong_name").text(engininfo.name);
                    }
                }

                $("#tong_number").text(data.number);
                $("#tong_feilei_name").text(data.feilei_name);
                $("#tong_money").text(parseFormatNum(data.money));
                $("#tong_dt").text(data.dt);

                if(engininfo){
                    $("#tong_name2").text(engininfo.name);
                }
                $("#tong_feilei_name2").text(data.feilei_name);
                $("#tong_money2").text(parseFormatNum(data.money));
                $("#tong_dt2").text(data.dt);
                $("#tong_koufee").text(data.koufee);


                set_right_relainfo(engininfo);




                if(engininfo){
                    $("#enginid_name").text(engininfo.name).click(function () {
                        openPage('../engin/show.php?id='+engininfo.id);
                    });

                    $("#daikouallfee").click(function () {
                        openNavPage('查看应扣费用表信息','lian_yingkou/index.php?status=1&enginid='+engininfo.id);
                    });
                }

                if(account){
                    $("#accid_name").text(account.name+'('+account.accnum+')').click(function () {
                        openPage('../account/show.php?id='+account.id);
                    });
                }

                $("#number").text(data.number);
                $("#feilei_name").text(data.feilei_name);
                $("#baner").text(data.baner);
                $("#zhai").text(data.zhai);
                $("#money").text(showChineseNumber(data.money));
                $("#duier").text(data.duier);
                $("#incdaotype_name").text(data.incdaotype_name);
                $("#dt").text(data.dt);
                $("#explain").text(data.explain);
                $("#daikouallfee").text(parseFormatNum(data.daikouallfee));
                $("#benguanfee").text(parseFormatNum(data.benguanfee));
                $("#daikouhanfee").text(parseFormatNum(data.daikouhanfee));
                $("#iskou").text(data.iskou);
                $("#koufee").text(data.koufee);
                $("#kouguanfee").text(data.kouguanfee);
                $("#koushuifee").text(data.koushuifee);
                $("#kouqifee").text(data.kouqifee);







                var mytableList = table.render({
                    elem: "#datalist_list",data:res.data.list, toolbar: '#toolbarDemo_list', page: false
                    ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                    ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                    ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                    , cols: [[
                        {type:'numbers',title:'序号',fixed:'left'}
                        ,{field: 'feitype_name', title: '费用项'}
                        ,{field: 'money', title: '到账金额(元)',align:'right',templet: function(d){return parseFormatNum(d.money);}}
                        ,{field: 'explain', title: '款项说明'}
                    ]]
                    , done: function (res) {
                        soulTable.render(this);
                    }
                });


                if(data.iskou == '是') {
                    $(".iskoushi").removeClass('layui-hide');

                    var koutableList = table.render({
                        elem: "#datalist_kou",data:res.data.kou, toolbar: '#toolbarDemo_kou', page: false
                        ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                        ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                        ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                        , cols: [[
                            {type:'numbers',title:'序号',fixed:'left'}
                            ,{field: 'lai', title: '来源'}
                            ,{field: 'feitype_name', title: '费用项'}
                            ,{field: 'money', title: '扣收金额(元)',align:'right',templet: function(d){return parseFormatNum(d.money);}}
                            ,{field: 'explain', title: '款项说明'}
                        ]]
                        , done: function (res) {
                            soulTable.render(this);
                        }
                    });
                }


                public_flow_show_display(res.data.billinfo);
                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('shou_xiang', param_id);
    });



</script>
</body>
</html>




